<?php
require_once("../../connection.php");

$gpid = $_POST['gpid'];
$val = mysql_real_escape_string($_POST['val']);
$type = $_POST['type'];

if($type == "name")
	$res = mysql_query("UPDATE site_groups SET `name`='$val' WHERE `id`='$gpid'");

if(!$res) echo mysql_error();
?>